#include "../include/CheckingAccount.hh"
#include <iostream>
#include <iomanip>

CheckingAccount::CheckingAccount(std::string id, std::string owner, double initialBalance)
    : Account(id, owner, initialBalance) {
}

void CheckingAccount::displayDetails() const {
    std::cout << "===== 支票账户 =====" << std::endl;
    std::cout << "账号: " << getAccountId() << std::endl;
    std::cout << "持有人: " << getOwnerName() << std::endl;
    
    // 显示各种货币的余额
    std::cout << "人民币余额: ¥" << std::fixed << std::setprecision(2) << getBalance(Currency::CNY) << std::endl;
    std::cout << "美元余额: $" << std::fixed << std::setprecision(2) << getBalance(Currency::USD) << std::endl;
    std::cout << "欧元余额: €" << std::fixed << std::setprecision(2) << getBalance(Currency::EUR) << std::endl;
}

std::string CheckingAccount::getAccountTypeName() const {
    return "支票账户";
}

bool CheckingAccount::canDeposit() const {
    // 支票账户可以存款
    return true;
}

bool CheckingAccount::canWithdraw() const {
    // 支票账户可以取款
    return true;
}

bool CheckingAccount::canTransferTo(const Account& destinationAccount) const {
    // 支票账户可以转账到任何账户
    return true;
}

bool CheckingAccount::deposit(double amount, const std::string& note) {
    // 使用基类的实现
    return Account::deposit(amount, note);
}

bool CheckingAccount::withdraw(double amount, const std::string& note) {
    // 使用基类的实现
    return Account::withdraw(amount, note);
}

